#define _CRT_SECURE_NO_WARNINGS 1
/**
 * Note: The returned array must be malloced, assume caller calls free().
 */
int* singleNumbers(int* nums, int numsSize, int* returnSize) {
    int ret = 0;
    int i = 0;
    int j = 0;
    int x = 0, y = 0;
    for (i = 0; i < numsSize; i++)
    {
        ret ^= nums[i];
    }
    for (j = 0; j < 32; j++)
    {
        if (ret & (1 << j))
            break;
    }
    for (i = 0; i < numsSize; i++)
    {
        if (nums[i] & (1 << j))
            x ^= nums[i];
        else
            y ^= nums[i];
    }
    int* arr = (int*)malloc(sizeof(int) * 2);
    arr[0] = x;
    arr[1] = y;
    *returnSize = 2;
}